package aop.annotation;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @date 2020/5/3 12:51
 */
public class Main {
    public static void main(String[] args) {
        testCGlib();
	}


	public static void testJDK(){
		ApplicationContext context
				= new AnnotationConfigApplicationContext(Config.class);
		Vehicle v = (Vehicle) context.getBean("c");
		v.drive();
	}
	public static void testCGlib(){
		ApplicationContext context
				= new AnnotationConfigApplicationContext(Config.class);
		System.out.println(context.getBean(MyAspectCGLIB.class));
		Bike bike = (Bike) context.getBean("b");
		bike.drive();
	}
}
